//
//  ScrollTableViewCell.m
//  Youhuiju
//
//  Created by yutenys on 16/7/25.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import "ScrollTableViewCell.h"
#import "ScrollCollectionViewCell.h"
@interface ScrollTableViewCell ()<UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,UICollectionViewDelegate>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;


@end

@implementation ScrollTableViewCell
static NSString *ScrollCollectionViewCellIden = @"ScrollCollectionViewCellIden";
- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
    
    
    [self.collectionView registerNib:[UINib nibWithNibName:@"ScrollCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:ScrollCollectionViewCellIden];
    
    // Initialization code
    
    
    
    
}


-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 3;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    ScrollCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ScrollCollectionViewCellIden forIndexPath:indexPath];
    
    return cell;
}

-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return CGSizeMake(115 * FitW, 115 * FitH);
}

-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section
{
    return 5 * FitW;
}

-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
    return 10 * FitH;
}

-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
    return UIEdgeInsetsMake(10 * FitH, 10 * FitW, 10 * FitH, 10 * FitW);
}

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
//    DLog(@"这是第%ld个item",indexPath.row);
    [self.clickedCellJumpDelegate scrollClickedCellJump];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
